package com.jw.qme.domain.po;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Builder;
import lombok.Getter;
import lombok.ToString;

import java.time.LocalDateTime;

/**
 * ClassName: com.jw.qme.domain.po
 * Datetime: 2025/4/4 下午7:02
 * Description:
 *
 * @author 汪佳泉
 * @version 1.0
 * @since 1.0
 */
@Getter
@ToString
@TableName("group_members")
public class GroupMember {

    @TableField("group_id")
    private String groupId; // 群聊ID

    @TableField("username")
    private String username; // 用户账户

    @TableField("role")
    private String role; // 成员角色（admin/member）

    @TableField(value = "joined_at", fill = FieldFill.INSERT) // 插入时自动填充
    private LocalDateTime joinedAt; // 加入时间

    public GroupMember(String groupId, String username, String role) {
        this.groupId = groupId;
        this.username = username;
        this.role = role;
    }

    public GroupMember(String groupId, String username, String role, LocalDateTime joinedAt) {
        this.groupId = groupId;
        this.username = username;
        this.role = role;
        this.joinedAt = joinedAt;
    }

}
